//
//@author jltxseo
// Created by junlintianxia on 2018/10/14.
//



#ifndef LEARNOPENGLANDROIDPRO_TUTORIALLESSONFIVE_H
#define LEARNOPENGLANDROIDPRO_TUTORIALLESSONFIVE_H

#include <util/Shader.h>
#include "../TutorialLesson.h"
#include "graphics/Matrix.h"

class TutorialLessonFive :public TutorialLesson{
public:
    TutorialLessonFive();
    ~TutorialLessonFive();
    virtual void create() override ;
    virtual void change(int width, int height) override ;
    virtual void draw() override ;
    void setBitmapForTexture(JNIEnv *env, jobject bitmap);

private:

    GLfloat rectangleVerticesData[12] = {
            1.0f, 1.0f, 0.0f,  //  top right
            1.0f, -1.0f, 0.0f, // bottom right
            -1.0f, -1.0f, 0.0f, // bottom left
            -1.0f, 1.0f, 0.0f, // top left
    };

    GLint rectangleVerticesIndex[6] = {
            0, 1, 3, // first triangle
            1, 2, 3  // second triangle
    };

    float textureCoord[8] = {
            1.0f, 0.0f,  // top right
            1.0f, 1.0f,  // bottom right
            0.0f, 1.0f,  // bottom left
            0.0f, 0.0f,  // top left
    };

    Shader *mShader;
    GLTexture *texture;
};


#endif //LEARNOPENGLANDROIDPRO_TUTORIALLESSONFIVE_H
